package ctrip.android.schedule.business.generate;

import ctrip.business.CtripBusinessBean;
import ctrip.business.handle.annotation.SerializeField;
import ctrip.business.handle.annotation.serialize_type;
{% for import_class in ClassSourceModel.import_class_list -%}
{{import_class}}
{% endfor %}
/**
 * @anthor zhuc
 * {{ClassSourceModel.description}}
 * {{ClassSourceModel.service_code}}
 */
public class {{ClassSourceModel.class_name}} extends CtripBusinessBean implements Cloneable{
	
	{% for field_model in ClassSourceModel.field_list -%}
	/**{{field_model.field_description}}*/
	@SerializeField(type=serialize_type.{{field_model.serialize_type}},length={{field_model.length}},index={{field_model.index}},require={% if field_model.require=="Y" %}true{% else %}false{% endif %}, serverType="{{field_model.server_type}}", format="{{field_model.format}}")
	public {{field_model.field_type}} {{field_model.field_name}} = {{field_model.default_value}};
	{% endfor %}
	
	public {{ClassSourceModel.class_name}}() {
		super();
		super.realServiceCode = "{{ClassSourceModel.service_code}}";
	}
	
	@Override
	public {{ClassSourceModel.class_name}} clone() {
		{{ClassSourceModel.class_name}} cloneObject = null;
		try {
			cloneObject = ({{ClassSourceModel.class_name}})super.clone();
			{% for field_model in ClassSourceModel.field_list -%}
			{% if field_model.field_type.startswith("<ArrayList") and field_model.field_type.endswith("Model") %}
			{{field_model.field_type}} clone{{field_model.field_name}} = ctrip.business.privateClass.BusinessListUtil.cloneList({{field_model.field_name}});
			cloneObject.{{field_model.field_name}} = clone{{field_model.field_name}};
			{% elif field_model.field_type.endswith("Model") -%}
			if(this.{{field_model.field_name}} != null)
				cloneObject.{{field_model.field_name}} = this.{{field_model.field_name}}.clone();
			{% endif %}
			{%- endfor %}
		} catch (Exception e) {
			ctrip.business.privateClass.BusinessLogUtil.d("Exception", e);
		}
		return cloneObject;
	}

}
